/**
 * 
 */
package com.facebookfetcher.Utlity;

import java.util.Calendar;
import java.util.Date;

import com.facebookdirectory.entity.Language;

/**
 * @author piglet
 *
 */
public class GlobalValue {

	private static final int ValidPeriod = 5; //7 days

	public static long getWorkInterval() {
		return 5*60*1000;//5 mins
	}

	public static Date getBenchmark() {
		Calendar date = Calendar.getInstance();
		date.add(Calendar.DATE, -ValidPeriod);		
		return date.getTime();
	}
	
	public static Language checkLanguage(String str)
	{
		Language lang = Language.ENGLISH;
		for(int i=0; i<str.length(); i++)
		{
			int value = str.charAt(i);
			if(value>0x3300&&value<0xA000)
			{
				lang=Language.CHINESE;
				break;
			}
			else if(value>0x036F)
			{
				lang = Language.OTHER;
				//break;
			}				
		}
		return lang;
		
	}

}
